class Robot(object):
    def __init__(self):
        self.x = 0
        self.y = 0

    def move(self, keyword):
        if keyword == "up":
            print("机器人正在上移")
            self.y += 1
        elif keyword == "down":
            print("机器人正在下移")
            self.y -= 1
        elif keyword == "right":
            print("机器人正在右移")
            self.x += 1
        elif keyword == "left":
            print("机器人正在左移")
            self.x -= 1

    def run(self):
        while True:
            keyword = input("请输入指令：")
            self.move(keyword)
            if self.x == 10 and self.y == 10:
                print("到达终点")
                break
            print("当前位置为 ({}, {})".format(self.x, self.y))


if __name__ == "__main__":
    robot = Robot()
    robot.run()
